﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Threading;

namespace AircraftBattleServer
{
    class Program
    {

        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost(typeof(GameEngineService));
            host.Open();
            Console.WriteLine("Game engine service has been successfully "
                + "hosted at:\n" + host.BaseAddresses[0]);

            // Open a new thread for periodically updating 
            // the map data
            BackgroundEngine be = new BackgroundEngine();
            Thread newThread = new Thread(new ThreadStart(be.Run));
            newThread.Start();

            // Enter to exit
            Console.Read();
            newThread.Abort();
        }
    }
}
